#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY ["WebApi/WebApi.csproj", "WebApi/"]
COPY ["ECI.Log/ECI.Log.csproj", "ECI.Log/"]
COPY ["WXQ.BusinessCore/WXQ.BusinessCore.csproj", "WXQ.BusinessCore/"]
COPY ["WXQ.InOutPutEntites/WXQ.InOutPutEntites.csproj", "WXQ.InOutPutEntites/"]
COPY ["WXQ.Enties/WXQ.Enties.csproj", "WXQ.Enties/"]
COPY ["Common/Common.csproj", "Common/"]
RUN dotnet restore "WebApi/WebApi.csproj"
COPY . .
WORKDIR "/src/WebApi"
RUN dotnet build "WebApi.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "WebApi.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "WebApi.dll"]